﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MVVMFramework.ViewModel
{
    public static class Global
    {
        public static event EventHandler<RoutedCommandExceptionEventArgs> RoutedCommandException;
        public static event EventHandler<ValidationFailedEventArgs> ValidationFailed;

        #region Internal

        internal static void RaiseRoutedCommandExceptionEvent(object sender, RoutedCommandExceptionEventArgs args)
        {
            var handler = RoutedCommandException;
            if (handler != null)
                handler.Invoke(sender, args);
        }

        internal static void RaiseValidationFailedEvent(object sender, ValidationFailedEventArgs args)
        {
            var handler = ValidationFailed;
            if (handler != null)
                handler.Invoke(sender, args);
        }

        #endregion
    }
}
